import { useState } from 'react';
import { onlineService } from '../ToolBar/toolbar';
const Sercive = ({}) => {
    const [run, setRun] = useState('');
    // close
    function close() {
        const currentElem = document.querySelector('.service-box');
        setRun('run_small');
        setTimeout(() => {
            currentElem.remove()
        }, 950)
    }
    return (
        <aside className={["service-box", run].join(' ')}>
            <div className="close" title="关闭" onClick={() => { close() }}>×</div>
            <div className="main" onClick={() => { onlineService() }}>
                <span className="iconfont icon-kefu"></span>
            </div>
            <div className="text" onClick={() => { onlineService() }}>在线咨询</div>
        </aside>
    )
}

export default Sercive